<template>
    <ul :class="classes">
        <slot></slot>
    </ul>
</template>
<script>
    const prefixCls = 'at-timeline';

    export default {
        name: 'Timeline',
        props: {
            pending: {
                type: Boolean,
                default: false
            }
        },
        computed: {
            classes () {
                return [
                    `${prefixCls}`,
                    {
                        [`${prefixCls}-pending`]: this.pending
                    }
                ];
            }
        }
    };
</script>
<style>
.at-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.at-timeline-item {
  margin: 0 !important;
  padding: 0 0 12px 0;
  list-style: none;
  position: relative;
}
.at-timeline-item-tail {
  height: 100%;
  border-left: 1px solid #e9eaec;
  position: absolute;
  left: 6px;
  top: 0;
}
.at-timeline-item-pending .at-timeline-item-tail {
  display: none;
}
.at-timeline-item-head {
  width: 13px;
  height: 13px;
  background-color: #fff;
  border-radius: 50%;
  border: 1px solid transparent;
  position: absolute;
}
.at-timeline-item-head-blue {
  border-color: #2d8cf0;
  color: #2d8cf0;
}
.at-timeline-item-head-red {
  border-color: #ed3f14;
  color: #ed3f14;
}
.at-timeline-item-head-green {
  border-color: #19be6b;
  color: #19be6b;
}
.at-timeline-item-head-custom {
  width: 40px;
  height: auto;
  margin-top: 6px;
  padding: 3px 0;
  text-align: center;
  line-height: 1;
  border: 0;
  border-radius: 0;
  font-size: 14px;
  position: absolute;
  left: -13px;
  transform: translateY(-50%);
}
.at-timeline-item-content {
  padding: 1px 1px 10px 24px;
  font-size: 12px;
  position: relative;
  top: -3px;
}
.at-timeline-item:last-child .at-timeline-item-tail {
  display: none;
}
.at-timeline.at-timeline-pending .at-timeline-item:nth-last-of-type(2) .at-timeline-item-tail {
  border-left: 1px dotted #e9eaec;
}
.at-timeline.at-timeline-pending .at-timeline-item:nth-last-of-type(2) .at-timeline-item-content {
  min-height: 48px;
}

</style>
